import { Button } from 'antd';
import React from 'react';
import { useNavigate } from 'react-router-dom';
import { useRecoilState } from 'recoil';
import { homeTextState } from '@/state';
import Test from 'components/testComponent';
import styles from './demo.module.less';

const DemoPage = () => {
  const navigate = useNavigate();
  const [text, setText] = useRecoilState(homeTextState);

  const handChange = () => {
    let a = text;
    setText(a + '0');
  };
  const handShow = () => {
    console.log('测试箭头函数');
  };
  return (
    <div>
      DemoPage
      <Button type="primary" onClick={() => navigate('/login?age=18&name=gang&name=bububu')}>
        前往登录
      </Button>
      <Button onClick={() => navigate('/rich-text')}>跳转富文本</Button>
      <Button onClick={handChange}>change</Button>
      <h1 className={styles['textade']}>{text}</h1>
      <Test />
      <Button onClick={handShow}>show</Button>
    </div>
  );
};
export default DemoPage;
